#ifndef __STYLEMODEL_H__
#define __STYLEMODEL_H__

#include <QObject>
#include <QColor>
#include <QListWidget>
#include <QComboBox>

enum Alignment {styleLeft, styleCenter, styleRight, styleJustify};

class StyleItem : private QObject
{
	Q_OBJECT
public:
	StyleItem(QString name, QString font, QString size);
	StyleItem(QString name, QString font, QString size, int red, int green, int blue, bool bold, bool italic, bool underline, int alignment);
	
	QString styleName;
	QString styleFont;
	QString styleSize;
	QColor styleColor;
	bool styleBold;
	bool styleItalic;
	bool styleUnderline;
	int styleAlignment;
};

class StyleManager : public QObject
{
	Q_OBJECT
public:
	StyleManager();
	~StyleManager();
	
	int getStyleCount();
	QString getStyleName(int index);	
	
	QString getStyleFont(int index);
	QString getStyleSize(int index);
	QColor getStyleColor(int index);
	bool getStyleBold(int index);
	bool getStyleItalic(int index);
	bool getStyleUnderline(int index);
	int getStyleAlignment(int index);
	
	void setStyleFont(int index, QString font);
	void setStyleSize(int index, QString size);
	void setStyleColor(int index, QColor color);
	void setStyleBold(int index, bool bold);
	void setStyleItalic(int index, bool italic);
	void setStyleUnderline(int index, bool underline);
	void setStyleAlignment(int index, int alignment);
	
	int addStyle(QString name, QString font, QString size);
	
	void updateModelWithCurrentList(QListWidget *list);	
	
	void updateComboStyle(QComboBox *comboStyle);

private:
	QList<StyleItem *> *styleList;
	
	void readStyles();	
	void saveStyles();			
};

#endif // __STYLEMODEL_H__
